<template>
  <div class="app-container calendar-list-container">
    <!-- 机构信息 -->
    <h3>机构信息</h3>
    <div class="my_order_box my_b_info" style="margin-top: 20px">
      <div class="order_top_box">
        <div class="order_left">
          <span style="margin-left: 0px">机构名称：</span>
        </div>
        <div class="order_center">
          <span v-text="instituteForm.name" style="margin-left: 1px">
          </span>
        </div>
      </div>
      <div class="order_top_box">
        <div class="order_left">
          <span style="margin-left: 0px">机构简介：</span>
        </div>
        <div class="order_center">
          <span v-text="instituteForm.nickName" style="margin-left: 1px">
          </span>
        </div>
      </div>
      <div class="order_top_box">
        <div class="order_left">
          <span style="margin-left: 0px">机构类型：</span>
        </div>
        <div class="order_center">
          <span v-text="instituteForm.mechanismType" style="margin-left: 1px">
          </span>
        </div>
      </div>
      <div class="order_top_box">
        <div class="order_left">
          <span style="margin-left: 0px">具体位置：</span>
        </div>
        <div class="order_center">
          <span v-text="instituteForm.address" style="margin-left: 1px">具体位置：</span>
        </div>
      </div>
      <div class="order_top_box">
        <div class="order_left">
          <span style="margin-left: 0px">法人：</span>
        </div>
        <div class="order_center">
          <span v-text="instituteForm.legalPerson" style="margin-left: 1px">
          </span>
        </div>
      </div>
      <div class="order_top_box">
        <div class="order_left">
          <span style="margin-left: 0px">联系号码：</span>
        </div>
        <div class="order_center">
          <span v-text="instituteForm.telephone" style="margin-left: 1px">
          </span>
        </div>
      </div>
      <!--<div class="order_top_box">-->
      <!--<div class="order_left">-->
      <!--<span></span>-->
      <!--</div>-->
      <!--<span v-text="instituteForm.startTime" style="color:#4876ff;">-->
      <!--</span>-->
      <!--</div>-->
      <!--<el-form-item label="到期时间">-->
      <!--<span v-text="instituteForm.endTime" style="color:#4876ff;">-->
      <!--</span>-->
      <!--</el-form-item>-->
      <div class="order_top_box">
        <div class="order_left">
          <span style="margin-left: 0px">积分总额：</span>
        </div>
        <div class="order_center">
          <mt-button plain size="small" type="danger" style="color:orange;margin-left: 1px">
            {{instituteForm.integralAmountAll}}
          </mt-button>

        </div>
      </div>
      <div class="order_top_box">
        <div>
          <mt-button size="small" style="">超出额度收取1%的手续费</mt-button>
        </div>
      </div>
      <div class="order_top_box">
        <div class="order_left">
          <span style="margin-left: 0px">已用额度：</span>
        </div>
        <div class="order_center">
          <mt-button size="small"  style="color: green">
            {{instituteForm.integralAmountUsed}}
          </mt-button>
        </div>
      </div>
      <div class="order_top_box">
        <div class="order_center" style="text-align: center">
          <mt-button plain type="danger" size="small" @click="logout">退出登录</mt-button>
        </div>
      </div>
    </div>
  </div>
</template>

<style>
.demo-table-expand {
  font-size: 0;
}
.demo-table-expand label {
  width: 200px;
  color: #99a9bf;
}
.demo-table-expand .el-form-item {
  margin-right: 0;
  margin-bottom: 0;
}
</style>  

<script>
import {
  Button,
  Field,
  Navbar,
  TabItem,
  Picker
} from "../../node_modules/mint-ui";
export default {
  components: {
    Button,
    Field,
    Navbar,
    TabItem,
    Picker
  },
  data() {
    return {
      uInfs: {},
      qualificationsFileList: [],
      list: undefined,
      listLoading: true,
      mechanism: { qualifications: [] },
      provinces: {},
      cities: {},
      areas: {},
      queryId: {
        queryId: ""
      },
      regionsId: {
        id: 0
      },
      instituteForm: {
        name: undefined,
        nickName: undefined,
        mechanismType: undefined,
        address: undefined,
        legalPerson: undefined,
        telephone: undefined,
        startTime: undefined,
        endTime: undefined,
        qualifications: undefined,
        provinceId: undefined,
        cityId: undefined,
        areaId: undefined,
        province: undefined,
        city: undefined,
        area: undefined
      },
      dialogFormVisible: false,
      dialogFormVisibles: false,
      dialogStatus: ""
    };
  },
  created() {
    this.downValues();
  },
  methods: {
    downValues() {
      let _this = this;
      let uObj = {};
      if (window.sessionStorage.userInfo) {
        let uObj = JSON.parse(window.sessionStorage.userInfo);
        let useId = uObj.id;
        _this.$http
          .get("/mechanismadmin/mobile/userinfo", {
            params: {
              useId: useId
            }
          })
          .then(res => {
            _this.uInfs = res.data.data.user;
            _this.$http
              .get("/mechanismadmin/mobile/accountControl", {
                params: {
                  id: _this.uInfs.mechanismId
                }
              })
              .then(response => {
                this.instituteForm = response.data.data.mdList;
              });
          });
      }
    },
    logout() {
      let _this = this;
       let uObj = JSON.parse(window.sessionStorage.userInfo);
        let useId = uObj.id;
      window.sessionStorage.clear();
      _this.$http
        .get("/mechanismadmin/mobile/loginout", {
          params: {
            id: useId
          }
        })
        .then(response => {
         _this.$router.push({
        path: "/home"
      });
        });

      
    }
  }
};
</script>
